﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Theme_index_MyStudy : System.Web.UI.MasterPage
{
    protected PowerCreator.LMS.Web.Config.WebConfig config = new PowerCreator.LMS.Web.Config.WebConfig();
    protected string css_MyMsg="wxx1";
    protected string css_EditPWD="wxx1";
    protected string css_EditUser="wxx1";
    protected string css_StudyCenter="wxx";
    protected string css_PaperResearch="wxx1";
    protected string css_PrintScore="wxx1";
    protected string css_PrintLetter = "wxx1";
    protected string css_SelectCourse = "wxx1";
    protected string css_MyCourse = "wxx1";

    protected void Page_Load(object sender, EventArgs e)
    {
        BinderUserLogin();
        BinderMenu();
       // btn_out.Text = config.GetLanagerValueByKey("SignOut", PowerCreator.LMS.Language.LanagetItemType.WebTitle);
    }
    protected void lnkbtn_EN_Click(object sender, EventArgs e)
    {
        Session[PowerCreator.LMS.Web.Config.WebConfig.SESSION_USER_LANGEID] = "1";
    }
    protected void lnkbtn_CN_Click(object sender, EventArgs e)
    {
        Session[PowerCreator.LMS.Web.Config.WebConfig.SESSION_USER_LANGEID] = "0";
    }
    protected void BinderUserLogin()
    {
        if (Session[PowerCreator.LMS.Web.Config.WebConfig.SESSION_USER_USERINFO] == null)
        {
            //lal_UserLogin.Text = "<a  href=\"UserLogin.aspx\">登陆</a> |  <a  href=\"Register.aspx\">注册</a>";
            //btn_out.Visible = false;
        }
        else
        {
            PowerCreator.LMS.Web.DL.User.LoginEntity login = (PowerCreator.LMS.Web.DL.User.LoginEntity)Session[PowerCreator.LMS.Web.Config.WebConfig.SESSION_USER_USERINFO];
            //Response.Write(login);
            //Response.Write(login==null);
            //Response.Write(login.RealName);
            //Response.End();

            //lal_UserLogin.Text = login.RealName.Trim() + ",欢迎光临大连市教师在线学习中心！| ";
            //btn_out.Visible = true;
        }
    }
    private void BinderMenu()
    {
        if (Request.QueryString["TP"] != null)
        {
            string tp = Request.QueryString["TP"].ToString();
            if (tp == "1") //我的课堂
            {
                css_StudyCenter = "wxx";
            }
            else if (tp == "2") //我的消息
            {
                css_StudyCenter = "wxx1";
                css_MyMsg = "wxx";
            }
            else if (tp == "3") //修改密码
            {
                css_StudyCenter = "wxx1";
                css_EditPWD = "wxx";
            }
            else if (tp == "4") //修改个人资料
            {
                css_StudyCenter = "wxx1";
                css_EditUser = "wxx";
            }
            else if (tp == "5") //调查问卷
            {
                css_StudyCenter = "wxx1";
                css_PaperResearch = "wxx";
            }
            else if (tp == "6") //打印学分
            {
                css_StudyCenter = "wxx1";
                css_PrintScore = "wxx";
            }
            else if (tp == "7") //打印证书
            {
                css_StudyCenter = "wxx1";
                css_PrintLetter = "wxx";
            }
            else if (tp == "8") //选课中心
            {
                css_StudyCenter = "wxx1";
                css_SelectCourse = "wxx";
            }
            else if (tp == "9") //我的课程
            {
                css_StudyCenter = "wxx1";
                css_MyCourse = "wxx";
            }
        }
    }
    protected void btn_out_Click(object sender, EventArgs e)
    {
        PowerCreator.LMS.Web.User.User opUser = new PowerCreator.LMS.Web.User.User();
        //opUser.UpdateOnlineUserByUserID(GetLoginEntity.UserID);
        Session.Abandon();
        PowerCreator.LMS.Common.Script.Script.ReloadMe();
    }

}
